package com.alter.java.ai.langchain4j.service.impl;

import com.alter.java.ai.langchain4j.entity.Appointment;
import com.alter.java.ai.langchain4j.mapper.AppointmentMapper;
import com.alter.java.ai.langchain4j.service.IAppointmentService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@Service
public class AppointmentServiceImpl extends ServiceImpl<AppointmentMapper, Appointment> implements IAppointmentService {
        /**
         * 查询订单是否存在
         * @param appointment
         * @return
         */
        @Override
        public Appointment getOne(Appointment appointment) {
            LambdaQueryWrapper<Appointment> queryWrapper = new LambdaQueryWrapper<>();
            queryWrapper.eq(Appointment::getUserName, appointment.getUserName());
            queryWrapper.eq(Appointment::getIdCard, appointment.getIdCard());
            queryWrapper.eq(Appointment::getDepartment, appointment.getDepartment());
            queryWrapper.eq(Appointment::getDate, appointment.getDate());
            queryWrapper.eq(Appointment::getTime, appointment.getTime());
            Appointment appointmentDB = baseMapper.selectOne(queryWrapper);
            return appointmentDB;
        }



}
